#ifndef __DEBUG_H__
#define	__DEBUG_H__

#ifdef __cplusplus
extern "C" {
#endif

// #define DEGUG

#define DEBUG_TRACE_LEVEL	DEBUG_MSG_LEVEL_OFF

enum debug_msg_level {
	DEBUG_MSG_LEVEL_OFF     = 0,
	DEBUG_MSG_LEVEL_ERROR,
	DEBUG_MSG_LEVEL_WARNING,
	DEBUG_MSG_LEVEL_INFO,
	DEBUG_MSG_LEVEL_VERBOSE,
	DEBUG_MSG_LEVEL_DEBUG,
	DEBUG_MSG_LEVEL_MAX
};

#undef  trace_dbg
#define trace_dbg(level, msg...) do { \
		if((level) >= DEBUG_TRACE_LEVEL) { \
			printf("\033[0;31m file:%s,Func:%s,Line:%d\033[0;39m\n",__FILE__, __FUNCTION__, __LINE__);\
			printf(msg); \
			printf("\n"); \
		} \
	}while(0)



#ifdef __cplusplus
}
#endif

#endif /* __DEBUG_H__ */
